package com.barcamp.bean;

import javax.faces.component.UIData;

import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.barcamp.entity.User;
import com.barcamp.manager.UserManager;

public class UserBean extends SqlMapClientDaoSupport
{
	private UIData logindata;
	private User user;
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public UIData getLogindata() {
		return logindata;
	}

	public void setLogindata(UIData logindata) {
		this.logindata = logindata;
	}
	public String login()
	{

		getManager();

		//getManager().

		return "successful";
	}
	public UserManager getManager()
	{
		UserManager userManager = null;
		XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("spring-beans.xml"));
		userManager =(UserManager)factory.getBean("UserManager");
		return userManager;
	}
}
